package com.senven.common.user.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

import java.util.ArrayList;

@Configuration
public class SwaggerConfiguration {


        @Bean
        public Docket dacket(){
            Docket docket = new Docket(DocumentationType.SWAGGER_2)
                    .apiInfo(apiInfo())//设置api文档信息
                    .select()
                    .apis(RequestHandlerSelectors.basePackage("user.controller"))
                    .build()
                    ;//swagger所有的功能都封装在Docket中
            return docket;
        }
        public ApiInfo apiInfo(){
            Contact DEFAULT_CONTACT= new Contact("wmd","http://localhost:8201/user/","wmd.qq.com");
            ApiInfo apiInfo = new ApiInfo("用户的相关操作", "用户操作的全部接口",
                    "v1.0", "wmd.url", DEFAULT_CONTACT, "Apache .wmd.1.0",
                    "wmd.baidu.com", new ArrayList());

            return apiInfo;
        }

}
